class Person(object):
    name = "Leslie" # 类属性
    def __init__(self):
        self.age = 18 # 实例属性
        self.gender = "Male" # 实例属性
        print(f"Person {self.name} is created with {self.age} years,{self.gender}")

    def play(self):
        print(f"{self.name} is playing!")

    @staticmethod
    def introduce():
        print(f"{Person.name},This is a static method. It does not depend on class or instance")

    @classmethod
    def greet(cls):
        print(f"{cls.name},This is a class method. It depends on class {cls.__name__} and can access class attributes")

p1 = Person( )
p1.play()
Person.introduce() # 静态方法可以通过类名直接调用
p1.introduce() # 静态方法也可以通过实例调用 静态方法与类无关,不需要传递 cls 或 self 参数

Person.greet() # 类方法可以通过类名直接调用